$(document).ready(function () {
    var js_info = null;
    $.ajax({
        url: 'http://szhqg.horsevision.cn/weixin/activity/js-info',
        type: 'POST',
        async: false,
        data: {
            url: window.location.href
        },
        success: function (res) {
            js_info = res.data;
        }
    });
    var js = new Function(js_info)
    js()
    var weixin = {
    share: function (option) {
        wx.ready(function () {
            //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
            wx.onMenuShareTimeline({
                title: option.Title, // 分享标题
                link: option.Url, // 分享链接
                imgUrl: option.Img, // 分享图标
                success: function (e) {
                    //  window.location.href = "http://qgx-bl.horsevision.cn/weixin?act=qingguo&mod=goodsDetails&id=199";
                    // if (option.callsuccess != undefined) {
                    //     option.callsuccess(e);
                    // }
                },
                cancel: function (e) {
                    if (option.callcancel != undefined) {
                        option.callcancel(e);
                    }
                }
            });
            //获取“分享给朋友”按钮点击状态及自定义分享内容接口
            wx.onMenuShareAppMessage({
                title: option.Title, // 分享标题
                desc: option.Desc, // 分享描述
                link: option.Url, // 分享链接
                imgUrl: option.Img, // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function (e) {
                    //  window.location.href = "http://qgx-bl.horsevision.cn/weixin?act=qingguo&mod=goodsDetails&id=199";
                    // if (option.callsuccess != undefined) {
                    //     option.callsuccess(e);
                    // }
                },
                cancel: function (e) {
                    if (option.callcancel != undefined) {
                        option.callcancel(e);
                    }
                }
            });
            //获取“分享到QQ”按钮点击状态及自定义分享内容接口
            wx.onMenuShareQQ({
                title: option.Title, // 分享标题
                desc: option.Desc, // 分享描述
                link: option.Url, // 分享链接
                imgUrl: option.Img, // 分享图标
                success: function (e) {
                    if (option.callsuccess != undefined) {
                        option.callsuccess(e);
                    }
                },
                cancel: function (e) {
                    if (option.callcancel != undefined) {
                        option.callcancel(e);
                    }
                }
            });
        });
    }
    };
    var shareWord = "苏州环球港红包雨来了！";
    var shareUrl = "http://szhqg.horsevision.cn/vue/index.html";
    var shareDesc = "“雨神”降临苏州环球港，狂撒现金红包~";
    // var shareDesc = "一封送你的中秋祝福~";
    var shareImg = "http://szhqg.horsevision.cn/vue/images/share.jpg";
    weixin.share({Title: shareWord, Url: shareUrl, Desc: shareDesc, Img: shareImg});
});